﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cecbData;

namespace cecbClasses.Data_Adapters
{
    public  class Func_Components
    {
        public Func_Components() 
        {
            dataContext = new DSSEntities();
        }

        DSSEntities dataContext;
        public List<Components> getComponents()
        {

            IQueryable<Components> Query =
                  from c in dataContext.Components
                  select c;

            List<Components> SelectedComponent = Query.ToList();

            return SelectedComponent;

        }

        public List<Components> getProjectDetails()
        {

            IQueryable<Components> Query =
                  from c in dataContext.Components
                  select c;

            List<Components> SelectedComponent = Query.ToList();

            return SelectedComponent;

        }


        public List<Components> getComponentDetails()
        {

            IQueryable<Components> Query =
                  from c in dataContext.Components
                  select c;

            List<Components> SelectedComponent = Query.ToList();

            return SelectedComponent;

        }

        public List<Components> getComponentDetailsByName(String name)
        {

            IQueryable<Components> Query =
                  from c in dataContext.Components
                  where c.cmpt_name.Contains(name)
                  select c;

            List<Components> SelectedComponent = Query.ToList();

            return SelectedComponent;

        }






    }
}
